﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Petroleum.DB;
using Petroleum.DB.Model;

namespace Petroleum.UC.Public
{
    public partial class GridTable_AgeSelect : UserControl, HZH_Controls.Controls.IDataGridViewCustomCell
    {
        private Pressure m_object = null;
        
        public GridTable_AgeSelect()
        {
            InitializeComponent();
        }

        public void SetBindSource(object obj)
        {
            if (obj is Pressure)
                m_object = (Pressure)obj;
        }

        private void GridTable_AgeSelect_Load(object sender, EventArgs e)
        {
            List<KeyValuePair<string, string>> lstCom = new List<KeyValuePair<string, string>>()
            {
                new KeyValuePair<string, string>("Miocene - Quaternary","Miocene - Quaternary"),
                new KeyValuePair<string, string>("Oligocene","Oligocene"),
                new KeyValuePair<string, string>("Paloe - Eocene","Paloe - Eocene"),
                new KeyValuePair<string, string>("Upper - cretac","Upper - cretac"),
                new KeyValuePair<string, string>("Mamastrichtian","Mamastrichtian"),
                new KeyValuePair<string, string>("Companian - Coniacian","Companian - Coniacian"),
                new KeyValuePair<string, string>("Turonian - Cenomanian","Turonian - Cenomanian"),

            };
            Age.Source = lstCom;
            Age.SelectedIndex = 1;
        }

        private void ucCombox1_SelectedChangedEvent(object sender, EventArgs e)
        {
            if (m_object != null)
            {
                Text = Age.SelectedValue;
                m_object.Age = Age.SelectedValue;
                //HZH_Controls.Forms.FrmTips.ShowTipsSuccess(this.FindForm(), "选中：" + Age.SelectedValue);
            }
        }
    }
}
